﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Epitech.Krisk.Xna.ScreenManagerLib;

namespace Epitech.Krisk.Xna.UI.Test
{
    class MainMenu : MenuScreen
    {
        public MainMenu()
            : base("")
        {
            // Create our menu entries.
            LayoutEntry Menu = new LayoutEntry(new Vector2(500f, 200f));
            MenuEntry playGameMenuEntry = new MenuEntry("playgame", true);
            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            LayoutEntry Menu1 = new LayoutEntry(new Vector2(200f, 200f));
            MenuEntry playGameMenuEntry1 = new MenuEntry("playgame", true);
            MenuEntry optionsMenuEntry1 = new MenuEntry("Options");
            MenuEntry exitMenuEntry1 = new MenuEntry("Exit");

            Menu.MenuEntries.Add(playGameMenuEntry);
            Menu.MenuEntries.Add(optionsMenuEntry);
            Menu.MenuEntries.Add(exitMenuEntry);
            Menu1.MenuEntries.Add(playGameMenuEntry1);
            Menu1.MenuEntries.Add(optionsMenuEntry1);
            Menu1.MenuEntries.Add(exitMenuEntry1);
            // Hook up menu event handlers.
            playGameMenuEntry.Selected += OnCancel;
            optionsMenuEntry.Selected += OnCancel;
            exitMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(Menu);
            MenuEntries.Add(Menu1);
        }

        #region Handle Input


        /// <summary>
        /// When the user cancels the main menu, ask if they want to exit the sample.
        /// </summary>
        protected override void OnCancel(PlayerIndex playerIndex)
        {
            ScreenManager.Game.Exit();
        }

        #endregion
    }
}
